<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>numDim :: Functions (k-Wave)</title>
	<link rel="stylesheet" href="kwavehelpstyle.css" type="text/css">
</head>

<body>
<div class="content">

<h1>numDim</h1>
<p class="purpose">Return the number of matrix dimensions.</p>

<h2>Syntax</h2>

<pre class="codeinput">
dim = numDim(x)
</pre>

<h2>Description</h2>
<p><code>numDim</code> returns the number of dimensions of a matrix <code>x</code>. Unlike the inbuilt <code><a href="matlab: doc ndims">ndims</a></code>, <code>numDim</code> returns 1 for 1D vectors, 2 for 2D arrays, etc. </p>

<h2>Inputs</h2>

<table class="body">
    <tr valign="top">
        <td width = "150"><code>x</code></td>
        <td>matrix with unknown number of dimensions</td>
    </tr>    
</table>

<h2>Outputs</h2>

<table class="body">
    <tr valign="top">
        <td width = "150"><code>dim</code></td>
        <td>number of dimensions</td>
    </tr>
</table>

<h2>See Also</h2>

<code><a href="matlab: doc ndims">ndims</a></code>

</div></body></html>